#include<iostream>
#include"Threadpool.hpp"
#include<memory>
#include<ctime>
#include"Task.hpp"
using namespace std;

int main()
{
    // unique_ptr<ThreadPool<Task>> tp(new ThreadPool<Task>());
    // tp->Start();

//得到单例，并执行
    ThreadPool<Task>::GetInstance()->Start();

    srand((uint64_t)time(nullptr)&getpid());
    while(true)
    {
        int x = rand() % 100 + 1;
        usleep(1234);
        int y = rand() % 200 + 1;
        usleep(1234);
        char oper = opers[rand() % opers.size()];
        usleep(1234);

        
        Task t(x,y,oper);
        ThreadPool<Task>::GetInstance()->Push(t);
    }


   ThreadPool<Task>::GetInstance()->Wait();

    return 0;
}